package com.ebt.m.policy.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.ebt.m.R;
import com.ebt.m.commons.buscomponent.listview.IView;


/**
 * @author Damon.Han
 */
public class SearchHistoryTitle extends IView {
    TextView timeLabel;
    ImageButton delete;
    View divider;

    public SearchHistoryTitle(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        inflate(context, R.layout.view_online_policy_search_history_title, this);
        timeLabel = (TextView) findViewById(R.id.tx_time);
        delete = findViewById(R.id.delete);
        divider = findViewById(R.id.divider);
    }

    public SearchHistoryTitle(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public SearchHistoryTitle(Context context) {
        this(context, null);
    }

    @Override
    public void update(Object... args) {
        delete.setOnClickListener(view -> {
            if (mOnclickListner != null) {
                mOnclickListner.onClick(view);
            }
        });

    }
}
